home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_item_bazooka.cog < prev    next >
Text File  |  1999-11-15  |  2KB  |  130 lines

  1. # Jones 3D Cog Script
  2. #
  3. # item_Bazooka.cog
  4. #
  5. # [RT]
  6. #
  7. # (C) 1998 LucasArts Entertainment Company LLC. All Rights Reserved
  8. #
  9. # ===================================================================
  10.  
  11. symbols
  12.  
  13. message    activated
  14. message    touched
  15. message    taken
  16.  
  17. sound    found=INXJ164.wav        local
  18. sound    foundOne=INXJ258.wav    local
  19. sound    foundPack=INXJ166.wav    local
  20.  
  21. thing    player                    local
  22. thing    sender                    local
  23.  
  24. int        bin=10                    local
  25. int        curAmount                local
  26.  
  27. int        bUnderwater                local
  28. int        bFound                    local
  29.  
  30. end
  31.  
  32. # ===================================================================
  33.  
  34. code
  35.  
  36. activated:
  37.  
  38.     player = GetSourceRef();
  39.  
  40.     StartCutscene(0);
  41.  
  42.     if (Rand() < 0.5)
  43.     {
  44.         SetExtCamOffset('0.15 -0.05 0.04');
  45.     }
  46.     else
  47.     {
  48.         SetExtCamOffset('-0.15 -0.05 0.04');
  49.     }
  50.     SetExtCamLookOffset('0.0 0.02 -0.01');
  51.  
  52.     return;
  53.  
  54. # -------------------------------------------------------------------
  55.  
  56. touched:
  57.  
  58.     player = GetSourceRef();
  59.     sender = GetSenderRef();
  60.     curAmount = GetInv(player, bin);
  61.  
  62.     if (curAmount < GetInvMax(player, bin))
  63.     {
  64.         TakeItem(sender, player);
  65.     }
  66.     else
  67.     {
  68.         EndCutscene();
  69.     }
  70.     
  71.     return;
  72.  
  73. # -------------------------------------------------------------------
  74.  
  75. taken:
  76.  
  77.     player = GetSourceRef();
  78.     sender = GetSenderRef();
  79.     bUnderwater = BitTest(GetThingFlags(player), 0x02000000);
  80.     bFound = IsItemFound(bin);
  81.  
  82.     if (IsThingModelName(sender, "weap_rocket_pack.3do"))
  83.     {
  84.         JonesInvItemChanged(119);
  85.         ChangeInv(player, bin, 3);
  86.         SetInvAvailable(player, bin, 1);
  87.  
  88.         Sleep(1.0);
  89.  
  90.         if (!bUnderwater)
  91.             PlayVoice(player, foundPack, 1.0, 0);
  92.     }
  93.     else if (IsThingModelName(sender, "gen_rckt_bzooka.3do"))
  94.     {
  95.         JonesInvItemChanged(bin);
  96.         ChangeInv(player, bin, 1);
  97.         SetInvAvailable(player, bin, 1);
  98.  
  99.         Sleep(1.0);
  100.  
  101.         if (!bUnderwater)
  102.             PlayVoice(player, foundOne, 1.0, 0);
  103.     }
  104.     else
  105.     {
  106.         JonesInvItemChanged(bin);
  107.         ChangeInv(player, bin, 3);
  108.         SetInvAvailable(player, bin, 1);
  109.  
  110.         Sleep(1.0);
  111.  
  112.         if (!bUnderwater)
  113.         {
  114.             if (curAmount < 1 && !bFound)
  115.             {
  116.                 PlayVoice(player, found, 1.0, 0);
  117.             }
  118.             else
  119.             {
  120.                 PlayVoice(player, foundPack, 1.0, 0);
  121.             }
  122.         }
  123.     }
  124.  
  125.     EndCutscene();
  126.  
  127.     return;
  128.  
  129. end
  130.